Skip to content

Conversation

joshua-spacetime
Copy link
Collaborator

@joshua-spacetime joshua-spacetime commented Oct 10, 2025

Description of Changes

Adds the #[view] procedural macro and module describers for views.

#[view(public)]
fn player(ctx: &ViewContext) -> Vec<Player> {
    ctx.db.player().identity().find(ctx.sender).into_iter().collect()
}

#[view(public, anonymous)]
fn player(ctx: &AnonymousViewContext, level: u32) -> Vec<Player> {
    ctx.db.player().level().filter(level).collect()
}

TODO:

  1. Support for T and Option<T> return types
  2. System table updates and module validation on publish

API and ABI breaking changes

None

Expected complexity level and risk

2

Testing

  • Negative compile tests
  • Negative publish (module validation) tests
  • Test system tables are updated accurately

gefjon added 4 commits October 9, 2025 11:36
This commit extends various schema and schema-adjacent structures to describe procedures,
a new kind of database function which are allowed to perform side effects.

This includes extending `RawModuleDefV9` with a way to register `RawProcedureDefV9`s
in the `misc_exports`, preserving compatibility with modules that predate procedures.

The module validation path is reorganized somewhat
to validate various properties related to procedures
while preserving code clarity and maintainability.

Additionally, the `ArgsTuple` machinery for ser/de-ing reducer arguments
using the argument type as a seed is extended to also support procedure arguments.

All of this is currently unused.
Prior to this commit, we never actually checked that reducers had unique names.
My new `check_function_names_are_unique` assumed this invariant,
but we were silently ignoring duplicate reducer names.

With this commit, `check_function_names_are_unique` actually validates uniqueness
not only between the two sets, but within them.

This commit also adds three tests for the three possible ways to have a duplicate name:
two reducers, two procedures, or one of each.
bfops and others added 16 commits October 15, 2025 15:45
# Description of Changes

* Small cleanups in `tools/check-diff.sh`
* Use `tools/check-diff.sh` wherever appropriate
* Simplify the `sdks/csharp/tools~/gen-*.sh` files after the repo merge

# API and ABI breaking changes

None.

# Expected complexity level and risk

1

# Testing

- [x] CI still passes

Co-authored-by: Zeke Foppa <[email protected]>
# Description of Changes

Check that our generated C# files are up-to-date in our CI.

# API and ABI breaking changes

None.

# Expected complexity level and risk

1

# Testing

- [x] CI all passes

---------

Co-authored-by: Zeke Foppa <[email protected]>
# Description of Changes

* Make sure the user provides at least one of `--rust-and-cli`,
`--typescript`, or `--csharp`, since providing none of them is a no-op
as of #3308
* Do a semver-parsing of the arg before doing anything, and use that
parsed version everywhere
* Consolidate some version strings that we were computing in a few
places

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Running `cargo bump-versions 1.5.0 --typescript --rust-and-cli
--csharp` only shows a diff in the change dates

---------

Co-authored-by: Zeke Foppa <[email protected]>
# Description of Changes

Host-side changes extracted from #3327 

I added AUTO_INC_OVERFLOW even though we don't currently ever return it,
in order to future-proof so it's already there when we start emitting
it.

Prepublish was failing because it was expecting a wasm module
unconditionally, so now it takes ?host_type.

I tweaked JS deser to accept null/undefined when the unit type or an
option type is expected.

I switched to bsatn, because the native sats->js translator wasn't
matching what js was expecting.

I renamed the sys module: my thinking is that `spacetime:` as a scheme
will help disambiguate it, and maybe it could also be used for IMC in
the future or something? And I believe we had discussed wanting this to
be versioned, similar to wasm imports.

Trying to get a borrowed str from deserialize_js doesn't work, because
v8 strings don't store utf8.

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] All this was done in the course of getting an actual typescript
module to successfully publish.
# Description of Changes

Python is funny, if a file `token.py` is created and another script run
on the same dir, it will cause python to block:

```python
python3-3.13.7/lib/python3.13/tokenize.py", line 35, in <module>
    from token import *
  File "/Users/mamcx/token.py", line 3, in <module>
    text = sys.stdin.read()
```

By coincidence the docs on `pg wire` use this name. Changed to one that
don't cause the trouble.

# Expected complexity level and risk
1

# Testing

- [x] Created another script and run it, see it blocks because this...
# Description of Changes

`console.log` debugging statements accidentally made it into the
release.

# API and ABI breaking changes

None

# Expected complexity level and risk

1, trivial

# Testing
- [x] Automated testing only
# Description of Changes

- Fixed logic issue around Option<Vec<Option<>>> applying the wrong
types for primitives and dropping Optional
- Fixed an issue with enum vs enum variants wrapped in Option<>
producing the incorrect Unreal type
- Removed unnecessary and incorrect header bindings
- Type fix in the tests around the Optional Int32

# API and ABI breaking changes

No breaking changes 

# Expected complexity level and risk

2 - Reworked incorrect optional lookups which can happen recursively

# Testing

I built out a few simple and complex objects in a Rust module to
triple-check possible cases beyond what the test framework calls out.

- [x] Tested many combinations from a Rust module to an Unreal project
- [x] Ran and updated Unreal test cases as necessary
# Description of Changes

Removes the use of the Derived Data Cache during CI, will in

# API and ABI breaking changes

None

# Expected complexity level and risk

1 - Small change for CI

# Testing

- [x] Re-ran tests on both Linux + Windows with the change
# Description of Changes

See the inline comments for the motivation. This was originally
introduced to our Windows CI in #3351. This PR moves it from CI to
general Windows target builds, since it seems like Windows builds are
now generally having this issue.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Windows CI still passes

---------

Co-authored-by: Zeke Foppa <[email protected]>
# Description of Changes

We've run into a problem on Maincloud caused by a database that was
writing a relatively small number of very large transactions. This was
accruing many commitlog segments consuming hundreds of gigabytes of
disk, but had not ever taken a snapshot, or compressed or archived any
data, as the database had not progressed past one million transactions.

With this PR, we take a snapshot every time the commitlog segment
rotates. We still also snapshot every million transactions.

One BitCraft database we looked at had 2.5 million transactions per
commitlog segment, meaning that this change will not meaningfully affect
the frequency of snapshots. The offending Maincloud database, however,
had only 50 transactions per segment!

# API and ABI breaking changes

N/a

# Expected complexity level and risk

3: Hastily made changes to finnicky code across several crates.

# Testing

I am unsure how to test these changes.

- [ ] <!-- maybe a test you want to do -->
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->
TableIndex merge logic to was missing  variants.

# Description of Changes

This pull request fixes an issue where the TableIndex::can_merge
function was missing match variants.

# API and ABI breaking changes

None.

# Expected complexity level and risk

1 / 5 (Trivial)
This is a very low-risk change. It simply adds a few lines to a match
statement

# Testing

Manual testing confirm that creating two tables with indices with the
for the missing variants no longer causes a panic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants